import React, { ReactNode } from 'react';
import { Button } from 'antd';
import { ObjectType } from '@/pages/riskControl/utils';
import style from './InquiryAreaButton.less';

export function InquiryAreaButton({
  leftButtonName = '查询',
  rightButtonName = '重置',
  leftButtonType = 'primary',
  className,
  handleResetCallBack,
  form,
}: ObjectType): ReactNode {
  return (
    <div className={style.InquiryAreaButtonWrap}>
      <Button type={leftButtonType} className={className} htmlType="submit">
        {leftButtonName}
      </Button>
      <Button
        onClick={() => {
          form.resetFields();
          if (typeof handleResetCallBack === 'function') handleResetCallBack();
        }}
      >
        {rightButtonName}
      </Button>
    </div>
  );
}
